package com.boang.web;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import java.io.IOException;

/*
  @author: 13813
  @date: 2024/7/16 10:28
*/
@WebServlet("/ss02")
public class HttpSessionDemo02 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session = req.getSession();
        String ss01 = (String) session.getAttribute("ss01");
        System.out.println("ss01 = " + ss01);

        String ss02 = (String) req.getAttribute("ss02");
        System.out.println("ss02 = " + ss02);
    }
}
